package com.share.zabbix.response;

import com.alibaba.fastjson.JSON;

import cn.hutool.core.date.DateUtil;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class ZabbixResponseAlert implements Serializable {
    private static final long serialVersionUID = -4269275252486828993L;

    private String eventid;
    private String sendto;
    private String clock;
    private String subject;
    private String message;
    private String alerttype;
    private String alertid;
  
    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
    
    public String getTime() {
        return DateUtil.format(new Date(Long.parseLong(clock) * 1000), "yyyy-MM-dd HH:mm:ss");
    }
}
